/**
 * This commands closes the database using the itemManager
 * @author remo.lemma@lu.unisi.ch & zulianp@lu.unisi.ch 
 */

package ch.unisi.inf.projects.java.uom.gui.commands;

import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;

import javax.swing.KeyStroke;

import ch.unisi.inf.projects.java.uom.elements.ItemManager;

public class CloseDatabaseCommand extends Command {
	
	private static final long serialVersionUID = -1L;
	
    public CloseDatabaseCommand ()
    {
        putValue(NAME,"Close Database");
        putValue(SHORT_DESCRIPTION,"Closes the current database");
        putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_W, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    }
	
	public void actionPerformed (final ActionEvent ev) { 
		ItemManager.instance().databaseClosed(); 
	}
}